#pragma once
#include <vector>
#include <utility>

class Snake {
public:
    Snake(int startX, int startY);
    void move(int dirX, int dirY);
    void grow();
    bool checkCollision() const;
    bool checkSelfCollision() const;
    const std::vector<std::pair<int, int>>& getBody() const { return body; }
    std::pair<int, int> getHead() const { return body.front(); }
    int getDirectionX() const { return directionX; }
    int getDirectionY() const { return directionY; }
    void setDirection(int dirX, int dirY);

private:
    std::vector<std::pair<int, int>> body;
    int directionX;
    int directionY;
    bool growing;
};